<template>
    <div>
        <ul class="mui-table-view">
            <li class="mui-table-view-cell mui-media" v-for="item in newlist" :key="item.id">
                <router-link :to="'/home/newinfo/'+item.id">
                    <img class="mui-media-object mui-pull-left" src="../../images/menu3.png">
                    <div class="mui-media-body">
                        <h6>{{item.title}}</h6>
                        <p class="mui-elipsis">
                            <span>发布时间：{{item.add_time|dateFormate('YYYY-MM-DD')}}</span>
                            <span>点击次数:{{item.click}}</span>
                        </p>
                    </div>
                </router-link>
            </li>
            
        </ul>
    </div>
</template>
<script>
    export default {
        data() {
            return {
                newlist: [],
            };
        },
        methods: {
            getNewList() {
                this.$http.get('/api/getnewslist').then(result => {
                    if (result.data.status === 0)
                        this.newlist=result.data.message
                        
                        else{
                            console("读取数据失败")
                        }
                })
            },
        },
        created() {
            this.getNewList()
        }
    }
</script>
<style lang="scss" scoped>
    .mui-media-body .mui-elipsis {
        color:#26a2ff;
        display: flex;
        justify-content: space-between;

    }
</style>